Introduction to the SLSIR package:

The simplest way to run a simulation is to use:

   simpleSimu=slsirSimu(pop=100,tstep=150)

This use defautl value whcih are detailed in the doc: ?slsirSimu

The output of the simulation can be visualised by adding:

   simpleSimu=slsirSimu(pop=100,tstep=150,visu=T)

In this visualisation, light blue squares represent agents conforming to social distancing, blue circle represent agents not conforming to social distancingcircle agents

A more conveniant way to run simulations, used in the paper, is to use generatePopulation to pre-generate population:

    pop=generatePopulation(N=100,xsize=100,ysize=100,speed=1,recovery=1)

This will create a table with all information about the population:

Then the properties of the population can be adjusted

    pop[c(10:20),"speed"]=5 #agents 10 to 20 will go five time more quiclkly than all other agents
   simpleSimu=slsirSimu(pop=pop,tstep=150,visu=T)

Now some simulations using the parameters from the paper:

    xsize=ysize=100
    poptest=generatePopulation(500,recovery=c(8,14)*25,speed=c(1,.2),xsize=xsize,ysize=ysize) 
    poptest[, "behavior"]=B
    a=slsirSimu(poptest,1500,p=c(1,.2),di=2,i0=1,inf=.9,sat=5,inf_r=.9,sat_r=5,xsize=xsize,ysize=ysize,visu=F,ap=F,ts=T,p_i=.01)